using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
namespace Lizk.SimpleHUD
{
#if !XBOX
    [TypeConverterAttribute(typeof(GeometryConverter))]
#endif
    [Serializable]
    public partial struct SizeS
    {
        private float width, height;

        public float Height
        {
            get { return height; }
            set { height = value; }
        }

        public float Width
        {
            get { return width; }
            set { width = value; }
        }

        public SizeS(float x, float y)
        {
            this.width = x;
            this.height = y;
        }

        public static SizeS operator +(SizeS a, SizeS b)
        {
            return new SizeS(a.width + b.width, a.height + b.height);
        }

        public static SizeS operator -(SizeS a, SizeS b)
        {
            return new SizeS(a.width - b.width, a.height - b.height);
        }

        public static SizeS operator *(SizeS a, float b)
        {
            return new SizeS(a.width * b, a.height * b);
        }

        public static implicit operator PointS(SizeS a)
        {
            return new PointS(a.width, a.height);
        }

        public static bool operator ==(SizeS a, SizeS b)
        {
            return a.Equals(b);
        }
        public static bool operator !=(SizeS a, SizeS b)
        {
            return !a.Equals(b);
        }
        public override bool Equals(object obj)
        {
            if (!(obj is SizeS))
                return false;

            SizeS b = (SizeS)obj;
            return width == b.width && height == b.height;
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public static SizeS Empty
        {
            get
            {
                return new SizeS();
            }
        }

    }

}
